﻿@using ThuySan.Areas.Backend.Models
@model ThuySan.Models.ProductModel
@{
    Layout = "~/Areas/Backend/Views/Shared/_Layout.cshtml";

    Header header = new Header {
                                       Common = "ViewUserControl_Product_Add",
                                       CurentCommon = "Product",
                                       PageHeader = "Add Product",
                                       Menulv1 = "01",
                                       Menulv2 = "0102"
                               };
    ViewData[Header.Key] = header;
    ViewBag.Title = "Add Product - Admin Control Panel";
    Html.EnableClientValidation();
}
<div class="content-box">
    <div class="content-box-header">
        <h3>
            Add Product</h3>
    </div>
    <div class="content-box-content">
        @using (Html.BeginForm("Add", "Product", FormMethod.Post, new {
                                                                              enctype = "multipart/form-data"
                                                                      }))
        {
            @Html.ValidationMessage("error")
            <div class="input-item">
                <label>
                    Category</label>
                @Html.DropDownListFor(c => c.CategoryId, (IEnumerable<SelectListItem>) ViewBag.Categories, new {
                                                                                                                       style = "width: 300px;"
                                                                                                               })
            </div>
            <div class="input-item">
                <label>
                    Name</label>
                @Html.TextBoxFor(c => c.Name, new {
                                                          @class = "text-input medium-input"
                                                  })
                @Html.ValidationMessageFor(c => c.Name)
            </div>
            <div class="input-item">
                <label>
                    Description</label>
                 @Html.TextAreaFor(c => c.Description, new {
                                                          @class = "text-input large-input"
                                                  })
                @Html.ValidationMessageFor(c => c.Description)
            </div>
            <div class="input-item">
                <label>
                    Detail</label>
                @{
                    Html.Telerik().Editor().Name("Detail").Encode(false).HtmlAttributes(new {
                                                                                                    style = "height:400px"
                                                                                            }).Value(Model.Detail).Render();
                }
            </div>
            <div class="input-item">
                <label>
                    Priority</label>
                @Html.TextBoxFor(c => c.Priority, new {
                                                              @class = "text-input tiny-input"
                                                      })
                @Html.ValidationMessageFor(c => c.Priority)
            </div>
            <div class="input-item">
                <label>
                    Image</label>
                <input type="file" name="thumbnail" id="thumbnail" />
                @Html.ValidationMessageFor(c => c.AvatarImage)
            </div>
           @* <div class="input-item">
                <label>
                    Price</label>
                @Html.TextBoxFor(c => c.Price, new {
                                                           @class = "text-input tiny-input"
                                                   })
                @Html.ValidationMessageFor(c => c.Price)
            </div>
            <div class="input-item">
                <label>
                    Promotional Price</label>
                @Html.TextBoxFor(c => c.PromotionalPrice, new {
                                                                      @class = "text-input tiny-input"
                                                              })
                @Html.ValidationMessageFor(c => c.PromotionalPrice)
            </div>*@
            <div class="input-item">
                <label>
                    Status</label>
                @Html.CheckBoxFor(c => c.Status)
                @Html.ValidationMessageFor(c => c.Status)
            </div>
            <div class="input-item">
                <label>
                    Reduced</label>
                @Html.CheckBoxFor(c => c.IsReduced)
                @Html.ValidationMessageFor(c => c.IsReduced)
            </div>
            <div class="input-item">
                <label>
                    Is Visibled</label>
                @Html.CheckBoxFor(c => c.IsVisibled)
                @Html.ValidationMessageFor(c => c.IsVisibled)
            </div>
            <div class="title-seperator">
                Page Information</div>
            <div class="seperator">
            </div>
            <div class="input-item">
                <label>
                    Url</label>
                @Html.TextBoxFor(c => c.PageUrl, new {
                                                             @class = "text-input medium-input"
                                                     })
                @Html.ValidationMessageFor(c => c.PageUrl)
            </div>
            <input type="submit" value="Update" class="button" />
            <input type="reset" value="Reset" class="button" />
        }
    </div>
</div>